Syntax

fun main() {
    var hello = 'hi mom'
    println(hello)
}
  • Has static typing.

  • The language uses camelCase for its functions.

    • :/ annoying.

  • Uses var  to declare variables (mutable variable).

  • Uses val  to declare constants (immutable variable).

  • Has automatic type inference, so both of these are equivalent:

    var hello = 'hi mom'
    var hello: String = 'hi mom'
    
  • Has 'null safety', using ?  to allow the type to be null.

    var hello: String? = 'hi mom'
    
    • Makes hello  nullable.

  • The use of ;  is optional.

  • Functions are 'first class objects', which is very good.

    • Can create lambdas, pass as parameters, etc.